#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by master on 2017/3/11

# 一端发送 一端接收
from multiprocessing import Process, Pipe


def f(conn):
    conn.send([42, None, 'hello'])
    conn.close()


if __name__ == '__main__':
    parent_conn, child_conn = Pipe()  # 创建管道 一端连接父进程 一端连接子进程
    p = Process(target=f, args=(child_conn,))
    p.start()
    print(parent_conn.recv())  # prints "[42, None, 'hello']"
    p.join()
